package com.lr.dao.User.impl;

import com.lr.dao.User.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

@Repository("userDao")
public class userDaoimpl implements UserDao {

    @Autowired
    JdbcTemplate jdbcTemplate;
    public boolean getUser(String name, String passwrod) {
     try {
         jdbcTemplate.queryForObject("select id from user where username=? and password=?",String.class,name,passwrod);
         return true;
     }
     catch (DataAccessException e)
     {
         return false;
     }



    }
}
